<%-- 
    Document   : application_msg_finish_all
    Created on : Feb 4, 2013, 2:50:36 AM
    Author     : owtee
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<link href="../css/smoothness/jquery-ui-1.10.0.custom.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-ui-1.10.0.custom.js"></script>  
<script type="text/javascript" src="../js/application.js"></script>

<div id="templatemo_main_wrapper">
    <div id="templatemo_main">
        <div id="content">             
            <div id="home" class="section">                                
                <table align="center" border="0">
                    <tr>
                        <td>
                            <form method="POST" action="ApplicationMsgFinishGetAll">                                                            
                                <table align="center" width="500px" border="0">
                                    <tr>
                                        <td colspan="4">${message.getMesDetail()}</td>
                                    </tr>        
                                    <tr>
                                        <td style="text-align: right; width: 25%;">วันที่ รับ/ส่ง เริ่ม :</td>
                                        <td style="text-align: left;">
                                            <input type="text" id="txtExpDateStKey" name="txtExpDateStKey" value="${txtExpDateStKey}" style="width: 80px;"/>
                                        </td>
                                        <td style="text-align: right; width: 25%">วันที่ รับ/ส่ง ถึง :</td>
                                        <td style="text-align: left;">
                                            <input type="text" id="txtExpDateEnKey" name="txtExpDateEnKey" value="${txtExpDateEnKey}" style="width: 80px;"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: right; width: 25%;">Job Id :</td>
                                        <td style="text-align: left;">
                                            <input type="text" id="txtJobIdKey" name="txtJobIdKey" value="${txtJobIdKey}" style="width: 80px;"/>
                                        </td>
                                        <td style="text-align: right; width: 25%">&nbsp;</td>
                                        <td style="text-align: left;">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="text-align: center;">
                                            <input type="image" src="../images/search.gif" onmouseout="src='../images/search.gif'" onmouseover="src='../images/search_hover.gif'" name="submit" value="ค้นหา" />
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </td>
                    </tr>
                    <tr>
                        <td>                            
                            <input type="button" value="กลับสู่เมนูหลัก" onclick="location.href='../view/menu.jsp'"/>
                        </td>
                    </tr>
                    <c:if test="${jobLst.size() > 0}">
                        <tr>
                            <td>
                                <fieldset>
                                    <legend> :: MSG Finish :: </legend>
                                        <table class="tbl_full" width="600px" align="center">
                                            <thead>
                                                <td width="18%">JobId</td>
                                                <td width="20%">วันที่สั่งงาน</td>
                                                <td width="20%">วันที่ รับ/ส่ง</td>
                                                <td width="22%">ช่วงเวลา</td>
                                                <td width="10%">ดูข้อมูล</td>
                                                <td width="10%">PDF</td> 
                                            </thead>                                
                                            <c:forEach items="${jobLst}" var="job" varStatus="status">
                                                <tbody>
                                                    <td style="text-align: center;">${job.getJobId()}</td>
                                                    <td style="text-align: center;">${job.getRequestDateFormat()}</td>
                                                    <td style="text-align: center;">${job.getExpectDateFormat()}</td>
                                                    <td style="text-align: center;">
                                                        ${job.getPeriodId().getPeriodName()}<c:if test="${job.getPeriodId().getPeriodId() == '4'}"> (<fmt:formatDate type="time" value="${job.getUrgentDate()}" />)</c:if>
                                                    </td>
                                                    <td style="text-align: center">
                                                        <input type="image" src="../images/watch.png" title="ดูข้อมูล" onclick="location.href='ApplicationViewPre?appId=${job.getJobId()}&fromPage=msgClose'"/>
                                                    </td> 
                                                    <td style="text-align: center">
                                                        <input type="image" src="../images/pdf.png" title="Print ใบงาน" onclick="window.open('Order?appId=${job.getJobId()}')"/>
                                                    </td>
                                                </tbody>
                                            </c:forEach>                                    
                                        </table>
                                </fieldset>
                            </td>
                        </tr> 
                        <tr>
                            <td style="text-align: right">                                                                    
                                <c:if test="${pageNo != 0}">                                    
                                    <a href="ApplicationMsgFinishGetAll?txtJobIdKey=${txtJobIdKey}&txtExpDateStKey=${txtExpDateStKey}&txtExpDateEnKey=${txtExpDateEnKey}&page_no=${pageNo - 1}"><<หน้าก่อนหน้า</a>&nbsp;
                                </c:if>
                                <c:forEach var="i" begin="0" end="${pageCount-1}">
                                    <c:choose>
                                        <c:when test="${i == pageNo}">
                                            ${i+1}&nbsp;
                                        </c:when>
                                        <c:otherwise>                                        
                                            <a href="ApplicationMsgFinishGetAll?txtJobIdKey=${txtJobIdKey}&txtExpDateStKey=${txtExpDateStKey}&txtExpDateEnKey=${txtExpDateEnKey}&page_no=${i}">${i+1}</a>&nbsp;
                                        </c:otherwise>
                                    </c:choose>                
                                </c:forEach>
                                <c:if test="${pageNo != (pageCount - 1)}">
                                    <a href="ApplicationMsgFinishGetAll?txtJobIdKey=${txtJobIdKey}&txtExpDateStKey=${txtExpDateStKey}&txtExpDateEnKey=${txtExpDateEnKey}&page_no=${pageNo + 1}">หน้าถัดไป>></a>
                                </c:if>  
                            </td>
                        </tr>
                    </c:if>
                </table>                
            </div>                         
        </div> 
    </div>
</div>
